package com.example.demo.dao;

import com.example.demo.entity.SysStationNotice;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

public interface SysStationNoticeMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_station_notice
     *
     * @mbg.generated
     */
    @Delete({
        "delete from sys_station_notice",
        "where order_id = #{orderId,jdbcType=INTEGER}",
          "and order_step = #{orderStep,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(@Param("orderId") Integer orderId, @Param("orderStep") Integer orderStep);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_station_notice
     *
     * @mbg.generated
     */
    @Insert({
        "insert into sys_station_notice (order_id, order_step, ",
        "is_read, notify_shop_id, ",
        "notify_customer_id, message, ",
        "create_datetime, create_by, ",
        "read_datetime, read_by)",
        "values (#{orderId,jdbcType=INTEGER}, #{orderStep,jdbcType=INTEGER}, ",
        "#{isRead,jdbcType=BIT}, #{notifyShopId,jdbcType=INTEGER}, ",
        "#{notifyCustomerId,jdbcType=INTEGER}, #{message,jdbcType=VARCHAR}, ",
        "#{createDatetime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, ",
        "#{readDatetime,jdbcType=TIMESTAMP}, #{readBy,jdbcType=INTEGER})"
    })
    int insert(SysStationNotice record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_station_notice
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "order_id, order_step, is_read, notify_shop_id, notify_customer_id, message, ",
        "create_datetime, create_by, read_datetime, read_by",
        "from sys_station_notice",
        "where order_id = #{orderId,jdbcType=INTEGER}",
          "and order_step = #{orderStep,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_step", property="orderStep", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="is_read", property="isRead", jdbcType=JdbcType.BIT),
        @Result(column="notify_shop_id", property="notifyShopId", jdbcType=JdbcType.INTEGER),
        @Result(column="notify_customer_id", property="notifyCustomerId", jdbcType=JdbcType.INTEGER),
        @Result(column="message", property="message", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_datetime", property="createDatetime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.INTEGER),
        @Result(column="read_datetime", property="readDatetime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="read_by", property="readBy", jdbcType=JdbcType.INTEGER)
    })
    SysStationNotice selectByPrimaryKey(@Param("orderId") Integer orderId, @Param("orderStep") Integer orderStep);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_station_notice
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "order_id, order_step, is_read, notify_shop_id, notify_customer_id, message, ",
        "create_datetime, create_by, read_datetime, read_by",
        "from sys_station_notice"
    })
    @Results({
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_step", property="orderStep", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="is_read", property="isRead", jdbcType=JdbcType.BIT),
        @Result(column="notify_shop_id", property="notifyShopId", jdbcType=JdbcType.INTEGER),
        @Result(column="notify_customer_id", property="notifyCustomerId", jdbcType=JdbcType.INTEGER),
        @Result(column="message", property="message", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_datetime", property="createDatetime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.INTEGER),
        @Result(column="read_datetime", property="readDatetime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="read_by", property="readBy", jdbcType=JdbcType.INTEGER)
    })
    List<SysStationNotice> selectAll();

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_station_notice
     *
     * @mbg.generated
     */
    @Update({
        "update sys_station_notice",
        "set is_read = #{isRead,jdbcType=BIT},",
          "notify_shop_id = #{notifyShopId,jdbcType=INTEGER},",
          "notify_customer_id = #{notifyCustomerId,jdbcType=INTEGER},",
          "message = #{message,jdbcType=VARCHAR},",
          "create_datetime = #{createDatetime,jdbcType=TIMESTAMP},",
          "create_by = #{createBy,jdbcType=INTEGER},",
          "read_datetime = #{readDatetime,jdbcType=TIMESTAMP},",
          "read_by = #{readBy,jdbcType=INTEGER}",
        "where order_id = #{orderId,jdbcType=INTEGER}",
          "and order_step = #{orderStep,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(SysStationNotice record);
}